package cn.wolfcode.wolf2w.web.controller;


import cn.wolfcode.wolf2w.domain.Spot;
import cn.wolfcode.wolf2w.service.ISpotService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController // Requestbody + controller
@RequestMapping("/spot")
public class SpotController {
    //
    @Autowired
    private ISpotService spotSerivce;//用jar包,相当于是同个项目了.可以用spotSerivce



   @Value("${sms.url}")
    private String smsUrl;//获取ap配置文件的数据
    @Value("${sms.appkey}")
    private String smsAppkey;
//检查用户名
    @GetMapping("/list")
    public Object list(String phone){
        List<Spot> spots = spotSerivce.listAll();

//spots
        return spots;
    }
    //trip-website/views/spot/list.html
//localhost8088:/views/spot/list.html
//    trip-website/views/spot/list.html
//trip-website/views/spot/detail.html
}
